import axios from '@/http/axios'
export default{
    namespaced:true,
    state:{
        waiterInfo:{},
        waiterOrder:[],
        waiterShou:[]
    },
    getters:{},
    mutations:{
        setWaiterInfo(state,data){
            state.waiterInfo=data
        },
        setWaiterOrder(state,data){
			state.waiterOrder = data
        },
        setWaiterShou(state,data){
			state.waiterShou = data
        }

    },
    actions:{
        async toLoadWaiterShou(context,params){
			let res = await axios.get('/waiter/detailsShou?id='+params)
			// console.log(res.data.data)
			context.commit('setWaiterShou',res.data.data)
		},
        async toLoadWaiterOrder(context,params){
			let res = await axios.get('/order/query?waiterId='+params)
			// console.log(res.data.data)
			context.commit('setWaiterOrder',res.data.data)
		},
        async toLoadWaiterInfo(context,params){
            let res = await axios.get('/waiter/findWaiterById?id='+params)
            context.commit('setWaiterInfo',res.data.data)
        }
    }
}